const cloud = require("@alipay/faas-server-sdk");
cloud.init({});

exports.main = async (event = {}, context) => {
  console.log('event', event);
  const bizContent = {
    "attributes": {
      "use_iot": "false",
      "_ROUTE_": "UA"
    },
    "params": {
      ...event
    },
    "service_code": "garbage.treasure.cv",
    "uri": "inference"
  }
  const res = await cloud.openapi.alipayCloudCloudbaseSaasAiUse.request({
    bizContent: JSON.stringify(bizContent)
  });
  console.log('云调用结果:', res);
  return res;
};